<template>
    <div id="packageLogList">
        <QueryItem :totalCount="totalCount" @dataQuery="queryPackageLogs" placeholder="请输入版本号进行查询"/>
        <ListItem />
        <PagerItem :totalCount="totalCount" @pageLoad="pageLoad"/>
    </div>
</template>

<script type="text/javascript">
import QueryItem from '../components/QueryItem'
import ListItem from '../components/ListItem'
import PagerItem from '../components/PagerItem'
export default {
    props: [''],
    components: { QueryItem, ListItem, PagerItem},
    methods: {
        queryPackageLogs(queryText){
            var queryParams = this.$store.state.packageLogQueryParams;
            queryParams.bq = '(version,like_and,' + queryText + ')';
            this.$store.commit("packageLogQueryParams",queryParams);
            this.$store.commit("getPackageLogs",queryParams);
        },
        pageLoad(pageNo,pageSize){
            var queryParams = this.$store.state.packageLogQueryParams;
            queryParams.start = pageSize * (pageNo-1);
            queryParams.limit = pageSize;
            this.$store.commit("updatePackageLogQueryParams",queryParams);
            this.$store.commit("getPackageLogs",queryParams);
        }
    },
    computed:{
        totalCount(){
            return this.$store.state.packageLogs.totalCount;
        }
    }
}
</script>

<style scoped>
#packageLogList{
  padding-top:40px;
}
</style>
